﻿
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using Model;


namespace MsDAL
{
    public partial class Sto7a01DAL : Sto7a01Base
    {
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public SqlApp Modify(Model.Sto7a01 model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update Sto7a01 set ");
            strSql.Append("productid=@productid ,tranqty=@tranqty ,tranprice=@tranprice ,tranamt=@tranamt ");
            strSql.Append("where detailid=@detailid ");
            SqlParameter[] parameters = {
				new SqlParameter("@productid", SqlDbType.NVarChar),
				new SqlParameter("@tranqty", SqlDbType.Decimal),
				new SqlParameter("@tranprice", SqlDbType.Decimal),
				new SqlParameter("@tranamt", SqlDbType.Decimal),
				new SqlParameter("@detailid", SqlDbType.NVarChar)
				};
            parameters[0].Value = model.Productid;
            parameters[1].Value = model.Tranqty;
            parameters[2].Value = model.Tranprice;
            parameters[3].Value = model.Tranamt;
            parameters[4].Value = model.Detailid;

            return new SqlApp(strSql.ToString(), new ArrayList(parameters), true, "数据保存失败！");
        }
    }
}
